package com.geotmt.billingcenter.modules.hive.service.impl;

import com.geotmt.billingcenter.common.entry.CostStatisEntry;
import com.geotmt.billingcenter.config.datasources.TargetDataSource;
import com.geotmt.billingcenter.modules.hive.mapper.CostHiveMapper;
import com.geotmt.billingcenter.modules.hive.service.CostHiveService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description Hive 成本Service
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/4/10 11:16
 * @Version     v1
 **/
@Service
public class CostHiveServiceImpl implements CostHiveService {

    private static final Logger logger = LoggerFactory.getLogger(CostHiveServiceImpl.class);

    @Resource
    private CostHiveMapper costHiveMapper;

    @Override
    @TargetDataSource(value = "hive")
    public List<CostStatisEntry> listCost(String dayFlag) {
        logger.info("Hive某天成本 Service");
        return costHiveMapper.listCost(dayFlag);
    }

    @Override
    public List<CostStatisEntry> listCostForDate(String startDay, String endDay) {
        logger.info("Hive某段时间成本 Service");
        return costHiveMapper.listCostForDate(startDay, endDay);
    }
}
